home *** CD-ROM | disk | FTP | other *** search
- //=--------------------------------------------------------------------------=
- // ButtonCtl.H
- //=--------------------------------------------------------------------------=
- // Copyright 1995 Microsoft Corporation. All Rights Reserved.
- //
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- // PARTICULAR PURPOSE.
- //=--------------------------------------------------------------------------=
- //
- // class declaration for the Button control.
- //
- #ifndef _BUTTONCONTROL_H_
-
- #include "IPServer.H"
- #include "CtrlObj.H"
- #include "ButtonInterfaces.H"
- #include "Dispids.H"
-
- typedef struct tagBUTTONCTLSTATE {
-
- char szCaption[128];
-
- } BUTTONCTLSTATE;
-
- //=--------------------------------------------------------------------------=
- // CButtonControl
- //=--------------------------------------------------------------------------=
- // our control.
- //
- class CButtonControl : public COleControl, public IButton, public ISupportErrorInfo {
-
- public:
- // IUnknown methods
- //
- DECLARE_STANDARD_UNKNOWN();
-
- // IDispatch methods
- //
- DECLARE_STANDARD_DISPATCH();
-
- // ISupportErrorInfo methods
- //
- DECLARE_STANDARD_SUPPORTERRORINFO();
-
- // IButton methods
- //
- // TODO: copy over the method declarations from ButtonInterfaces.H
- // don't forget to remove the PURE from them.
- //
- STDMETHOD(get_Caption)(BSTR FAR* pbstrCaption);
- STDMETHOD(put_Caption)(BSTR bstrCaption);
- STDMETHOD_(void, AboutBox)(void);
-
- // OLE Control stuff follows:
- //
- CButtonControl(IUnknown *pUnkOuter);
- virtual ~CButtonControl();
-
- // static creation function. all controls must have one of these!
- //
- static IUnknown *Create(IUnknown *);
-
- private:
- // overridables that the control must implement.
- //
- STDMETHOD(LoadBinaryState)(IStream *pStream);
- STDMETHOD(SaveBinaryState)(IStream *pStream);
- STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
- STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
- STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
- virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- virtual BOOL RegisterClassData(void);
-
- virtual HRESULT InternalQueryInterface(REFIID, void **);
- virtual void BeforeCreateWindow(void);
- virtual void AfterCreateWindow(void);
-
- // private state information.
- //
- BUTTONCTLSTATE m_state;
- };
-
-
- // TODO: if you have an array of verbs, then add an extern here with the name
- // of it, so that you can include it in the DEFINE_CONTROLOBJECT.
- // ie. extern VERBINFO m_ButtonCustomVerbs [];
- //
- extern const GUID *rgButtonPropPages [];
- DEFINE_CONTROLOBJECT(Button,
- &CLSID_Button,
- "ButtonCtl",
- CButtonControl::Create,
- 1,
- &IID_IButton,
- "Button.HLP",
- &DIID_DButtonEvents,
- OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
- RESID_TOOLBOX_BITMAP,
- "ButtonWndClass",
- 1,
- rgButtonPropPages,
- 0,
- NULL);
-
-
-
- #define _BUTTONCONTROL_H_
- #endif // _BUTTONCONTROL_H_
-
-